
package tetris.gui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JPanel;

import tetris.board.Board;

/**
 * 
 * The Game information side-bar, where player's score and current level and
 * also the preview piece are displayed.
 * 
 * @author Agari NLN (agarin@uw.edu)
 * @version 2.8
 * 
 */
public class GameInfo extends JPanel
{
  /**
   * This is here to avoid warnings.
   */
  private static final long serialVersionUID = 1L;

  /**
   * The default width.
   */
  private static final int DEFAULT_WIDTH = 150;
  
  /**
   * The default height.
   */
  private static final int DEFAULT_HEIGHT = 200;
  

  /**
   * Constructing a game status side-bar.
   * @param the_board the Tetris board(logic)
   */
  public GameInfo(final Board the_board)
  {
    super();
    Preview preview;
    GameStats stats;
    setPreferredSize(new Dimension(DEFAULT_WIDTH, DEFAULT_HEIGHT));
    setBackground(Color.WHITE);
    preview = new Preview(the_board);
    stats = new GameStats(the_board);
    add(preview,  BorderLayout.NORTH);
    add(stats,  BorderLayout.SOUTH);
    repaint();
  }
}
